package midway.madness.post;

import android.content.Context;
import android.text.Html;

public abstract class PostObject {
	
	public abstract void goForIntent();
	
	private String author;
	private String title;
	private String content;
	private String date;
	private String slug;
	private int id;
	private String[] comments;
	private Context context;
	
	public PostObject(Context pContext, String pAuthor, String pTitle, String pDate){
		context = pContext;
	}
	
	public PostObject(Context pContext, int pId, String pAuthor, String pTitle, String pContent, String pDate, String pSlug, String[] pComments){
		context = pContext;
		id = pId;
		author = pAuthor;
		title = pTitle;
		content = pContent.replaceAll("http://http://", "http://");
		date = pDate.split(" ")[0];
		slug = pSlug;
		comments = pComments;
	}

	public String getAuthor() {
		return author;
	}
	
	public String getTitle() {
		return title;
	}
	
	public String getContent() {
		return content;
	}
	
	public String getDate() {
		return date;
	}
	
	public int getId() {
		return id;
	}

	public String getSlug() {
		return slug;
	}

	public String[] getComments() {
		return comments;
	}

	public Context getContext() {
		return context;
	}

	public String toString(){
		return Html.fromHtml(title) + "\n" + author + " " + date;
	}
}
